#ifndef STOPWATCHVIEW_H
#define STOPWATCHVIEW_H

#include <QWidget>
#include <QPainter>
#include <QDebug>
#include <QtMath>
#include <QDialog>
#include <QPainter>
#include <QPaintEvent>
#include <QPainterPath>
#include <QRadialGradient>

#include <QTimer>
#include <QKeyEvent>

#include <QLabel>
#include <QHBoxLayout>
class StopWatchView : public QWidget
{
    Q_OBJECT
public:
    explicit StopWatchView(QWidget *parent = nullptr);
    QLabel *targetSpeedLabel;//速度
    QLabel *operationalLabel;
    QLabel *departLabel;



    QTimer *myTimer;//加速定时器
    int radius;//仪表盘的中心位置
    int direction;//指针运动的方向,1为前进，0为后退


public:
    QHBoxLayout *hLayout;



protected:
    void paintEvent(QPaintEvent*);
private:
    int degRotate =0;

private:
    void setUI();
    void DrawPoint(QPainter&,int);
    void DrawDigital(QPainter&,int);
    void DrawSmallScale(QPainter&,int);
    void DrawBigScale(QPainter&,int);
    void DrawNum(QPainter&,int);
    void DrawPointer(QPainter&,int);
    void drawIndicator(QPainter *painter);

private slots:
    void slot_speed_changed();

};

#endif // STOPWATCHVIEW_H
